<script>
 	var updateItemStatus = function(id) {
 	 	$.post('<?php echo site_url("report/update_order_item_status") ?>' + '/'+ id);
 	};
</script>
<div class="row-fluid sortable">
	<div class="box span12">
		<div class="box-header well" data-original-title>
			<h2>
				<i class="icon-user"></i> Thực đơn
			</h2>

		</div>
		<div class="box-content">
			<table
				class="table table-striped table-bordered bootstrap-datatable datatable" >
				<thead>
					<tr>

						<th>Tên món</th>
						<th>Số lượng</th>
						<th>Bàn</th>
						<th>Thời gian gọi</th>
						<th>Nguời tạo</th>
						<th>Đã mang ra</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach($listitem as $item):?>
					<tr <?php if (time() - strtotime($item->time_create) > 15*60){echo 'style="color:red"';} else if  (time() - strtotime($item->time_create) > 10*60){echo 'style="color:blue"';}?>>
						<td class="center" ><?php echo $item->item_name?></td>
						<td class="center" ><?php echo $item->amount?></td>
						<td class="center"><?php echo $item->order_name	?></td>
						<td class="center"><?php echo date("i:s", time() - strtotime($item->time_create))." phút"?></td>
						<td class="center"><?php echo $item->user_name?> </td>
						<td class="center"><input id="clickMe" class="btn btn-primary" type="button" value="Đã mang ra" onclick="updateItemStatus(<?php echo $item->id?>);" />
						</td>
					</tr>
					<?php endforeach;?>
				</tbody>
			</table>
		</div>
	</div>
	<!--/span-->

</div>
<!--/row-->
